{% extends 'base.html' %}
{% load myinclusion %}
{% block content %}
<div class="right_col" role="main">
    <div class="">
        <div class="clearfix"></div>

        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">

                <div class="x_panel">
                    <div class="x_title">
                        <h2>{{ page_name }} <small>|&nbsp;<a href="{% url 'group_list' %}">分组管理</a></h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                                <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
                                <ul class="dropdown-menu" role="menu">
                                    <li><a href="#">Settings 1</a>
                                    </li>
                                    <li><a href="#">Settings 2</a>
                                    </li>
                                </ul>
                                </li>
                                <li><a class="close-link"><i class="fa fa-close"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content">

                            <form class="form-horizontal form-border" method="post" action="" enctype="multipart/form-data">
                                {% csrf_token %}
                                {% if perms.deploy.edit_saltgroup %}
                                <fieldset>
                                {% else %}
                                <fieldset disabled="disabled">
                                {% endif %}
                                {% for i in form %}
                                <div class="item form-group">
                                    <label class="control-label col-md-3 col-sm-3 col-xs-12">{{ i.label_tag }} <span class="required">*</span>
                                    </label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            {{ i }}
                                            <div style="padding-top:10px;">
                                            {{ i.errors }}
                                            </div>
                                        </div>
                                </div>
                                {% endfor %}
                                {{ hform.as_p }}
                                <div class="ln_solid"></div>
                                <div class="form-group">
                                    <div class="col-md-6 col-md-offset-3">
                                        {% ifequal action 'add' %}
                                        <button id="send" type="submit" class="btn btn-success">添加</button>
                                        {% endifequal %}
                                        {% ifequal action 'edit' %}
                                        <button id="send" type="submit" class="btn btn-success">更新</button:q
                                        {% endifequal %}
                                    </div>
                                </div>
                                </fieldset>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}

